package vcp.controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;

import vcp.common.AbstractController;
import vcp.common.IController;
import vcp.models.OrdersModel;
import vcp.views.OrderGuestView;
import vcp.models.*;

public class OrdersGuestController extends AbstractController implements
		ActionListener, IController

{
	HashMap<String, Object> models = new HashMap<String, Object>();

	// private OrdersModel model;
	private OrderGuestView view;

	@Override
	public void actionPerformed(ActionEvent eve) {
		if (eve.getActionCommand().equals("orderOccasional")) {
			((OrdersOccasionalOrderModel) models
					.get("ordersOccasionalOrderModel")).createOccasionalOrder();
		} else if (eve.getActionCommand().equals("orderSubscription")) {
			((OrdersSubscriptionModel) models.get("ordersSubscriptionModel"))
					.createSubscriptionOrder();
		} else if (eve.getActionCommand().equals("orderTemporary")) {
			((OrdersTemporaryModel) models.get("ordersTemporaryModel"))
					.createTemporaryOrder();
		} else if (eve.getActionCommand().equals("cancelOrder")) {
			((OrdersCancelOrderModel) models.get("ordersCancelOrderModel"))
					.cancelOrder();
		} else if (eve.getActionCommand().equals("orderTrack")) {
			((OrdersTrackModel) models.get("ordersTrackModel"))
			.trackOrder();
		}

	}

	@Override
	public void addModel(String key, Object model) {
		models.put(key, model);
	}

	@Override
	public void addView(Object applicationView) {
		this.view = (OrderGuestView) applicationView;
	}

	@Override
	public void addModel(Object model) {
		// TODO Auto-generated method stub

	}

}
